vcSimulation
Object type for simulation engine, thereby providing access to the scene graph and simulation controls.
See in: Overview
Module: vcCore
Parent: vcObject
Children -
Referenced by: vcCore.getSimulation()
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| IsLooping | Boolean | RW | Gets or sets if the simulation gets automatically restarted when finished. |
| IsRunning | Boolean | R | Gets a value indicating if simulation is running in 3D world. |
| RealTimeMode | Boolean | RW | Gets or sets if a simulation runs in real time or virtual time.See moreA True value means the simulation runs at a speed indicative of the real world environment. A False value means the simulations runs at speed based on the device's CPU processing speed. |
| SimSpeed | Real | RW | Gets or sets the step size or speed of simulation. |
| SimTime | Real | R | Gets the current simulation time in seconds. |
| SimWarmupTime | Real | RW | Gets or sets a time in seconds of simulation warmup time. |
| SimulationRunTime | Real | RW | Gets or sets a time in seconds when simulation should stop running. Note: Changing the SimulationRunTime is only allowed in the OnRun event. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| autoHalt | Boolean | None | Stops a simulation if there is no active component running a script that generates simulation events. Returns: bool: Status of the halt operation. True on success, otherwise False. |
| halt | None | None | Stops a simulation immediately. |
| reset | None | None | Resets simulation and static components to initial state and sets simulation clock at zero. |
| restoreInitialState | None | None | Restores simulation and static components to initial state. |
| setFastScheduling | None | Boolean enabled | Updates the fast scheduling flag for all conveyors that support the property. Parameters: enabled (bool): Value to set. |
| setInitialState | None | None | Saves the current state of simulation and static components. Exceptions: RuntimeError: When no license for Simulation Settings API. |
| start | None | Optional Keyword[runtime = Real] | Starts simulation to run for the specified duration.See moreParameters: Optional: runtime (float): Simulation runtime in seconds. If not provided, simulation runs indefinitely. |
| update | None | None | Updates simulation and 3D world to reflect current state of components. |
Events
Learn how to use events here. The events are also inherited from the parent class.
| Name | Parameters | Description |
| OnStateChanged | vcSimulation simulation, vcSimulationState state | Triggered when simulation state was changed. Note: when simulation is reset, it will trigger this event 2 times, See morefirst with vcSimulationState.STOP and then vcSimulationState.RESET. Parameters: simulation (vcSimulation): Simulation object instance that was reset. state (vcSimulationState): State of the simulation. |